package main.Q2701_2800;

import java.util.*;

public class Q2781_2790 {
    public static void main(String[] args) {
        System.out.println("Question2781：");
        System.out.println("Question2782：");
        System.out.println("Question2783：");
        System.out.println("Question2784：");
        System.out.println("Question2785：将字符串中的元音字母排序");
        System.out.println("Question2786：");
        System.out.println("Question2787：");
        System.out.println("Question2788：");
        System.out.println("Question2789：");
        System.out.println("Question2790：");
    }
}

class Question2785 {
    public String sortVowels(String s) {
        char[] str = s.toCharArray();
        List<Integer> indexList = new ArrayList<>();
        List<Character> characterList = new ArrayList<>();
        Set<Character> set = new HashSet<>();
        set.add('a');
        set.add('e');
        set.add('i');
        set.add('o');
        set.add('u');
        set.add('A');
        set.add('E');
        set.add('I');
        set.add('O');
        set.add('U');
        for (int i = 0; i < str.length; i++) {
            if (set.contains(str[i])) {
                indexList.add(i);
                characterList.add(str[i]);
            }
        }
        Collections.sort(characterList);
        int i = 0;
        for (int index : indexList) {
            str[index] = characterList.get(i);
            i++;
        }
        return String.valueOf(str);
    }
}